package com.videri.match.server;

public class VideriUser {

	private String myHandle;
	private String myLastName;
	private String myFirstName;
	private String myPassword;
	private String myEmail;
	private int myRating;
	private double myPercentile;
	private int myNumSRMs;
	private int myNumPuzzTried;
	private int myNumPuzzSolved;
	
	public VideriUser(String lName, String fName, String handle, String passwd, String eAddr){
		myHandle = handle;
		myLastName = lName;
		myFirstName = fName;
		myPassword = passwd;
		myEmail = eAddr;
		myRating = -1;
		myPercentile = -1;
		myNumSRMs = 0;
		myNumPuzzTried = 0;
		myNumPuzzSolved = 0;
	}
	
	public String getHandle() {
		return myHandle;
	}
	
	public String getPassword() {
		return myPassword;
	}
	
	public void setPassword(String password) {
		myPassword = password;
	}
	
	public String getEmail() {
		return myEmail;
	}
	
	public void setEmail(String email) {
		myEmail = email;
	}
	
	public String getLastName(){
		return myLastName;
	}
	
	public String getFirstName(){
		return myFirstName;
	}
	
	public int getRating(){
		return myRating;
	}
	
	public void setRating(int rate){
		myRating = rate;
	}
	
	public double getPercentile(){
		return myPercentile;
	}
	
	public void setPercentile(double perc){
		myPercentile = perc;
	}
	
	public void updateStats(boolean solved){
		if(solved)
			myNumPuzzSolved++;
		myNumPuzzTried++;
	}
	
	public void updateSRM(int numPuzz, int numSolved){
		myNumSRMs++;
		myNumPuzzTried += numPuzz;
		myNumPuzzSolved += numSolved;
	}
	
	public int getNumSolvedPuzzles(){
		return myNumPuzzSolved;
	}
	
	public int getNumTriedPuzzles(){
		return myNumPuzzTried;
	}
}
